<?php
class Common
{
	private $db; 
	
	/**
	 * Delcampe_Stats::__construct()
	 * 
	 * @return void
	 */
	public function __construct() 
  	{ 
  		$this->db = Zend_Registry::get('db'); 
  	}
  	
	public function listCountries()
	{
		$options = $this->db->fetchPairs("
				select countryid,country_name
				from countries
		");

		return $options;
	}
	
 public function listCities()
	{
		$sql="select cityid,city_name from cities ";
		//echo $sql;exit;
		$options = $this->db->fetchPairs($sql);

		return $options;
	}

	public function getCity($country)
	{
		$sql="select cityid,city_name from cities where countryid=".$country."";
		//echo $sql;exit;
		$options = $this->db->fetchAll($sql);

		return $options;
	}
	
 public function getHotelbyCountry($country)
	{
		$sql="select hotel_id,hotel_title from hotels where hotel_country=".$country."";
		//echo $sql;exit;
		$options = $this->db->fetchAll($sql);

		return $options;
	}
	
	
}
?>
